Skip to content

Prep for PROD ECS - #16651

Open
aug24 wants to merge 2 commits into
mainfrom
jr/prep-for-prod-ecs
Open

Prep for PROD ECS#16651
aug24 wants to merge 2 commits into
mainfrom
jr/prep-for-prod-ecs

Conversation

@aug24

@aug24 aug24 commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

What does this change?

This PR adds ECS capability to the PROD tag rendering nodes, and exposes the effects via testing.

Why?

How has this change been tested?

Screenshots

Before After
before after

Comment thread dotcom-rendering/cdk/bin/cdk.ts Outdated
@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown

@aug24 aug24 added the feature Departmental tracking: work on a new feature label Sep 1, 2026

@akash1810 akash1810 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IIUC this PR, ultimately, adds a CDK snapshot test for the current state of tag-page-rendering PROD? If so, could we can make the diff smaller to make this more accessible for future travellers? For example, I don't think we need to convert from a const to a function?

Comment thread dotcom-rendering/cdk/bin/cdk.ts Outdated
@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown

🚀 Image pushed to AWS ECR

Image digest: sha256:bac9ea23513b66371b80d4566d193443da5995515de5a56dc1d9379ae7e60f93

🐛 Run the image locally

The following can be used to run the image locally:

# Refer to image using the immutable digest. Find alternatives below.
IMAGE_IDENTIFIER="@sha256:bac9ea23513b66371b80d4566d193443da5995515de5a56dc1d9379ae7e60f93"

# Refer to image using branch tag
# IMAGE_IDENTIFIER=":branch-jr-prep-for-prod-ecs"

# Refer to image using build tag
# IMAGE_IDENTIFIER=":build-30836"

# Refer to image via the GitHub commit SHA tag
# IMAGE_IDENTIFIER=":sha-7e3afab721fe3bf1730aa1fd595dd091a5b7e721"

# Set environment variables for the AWS CLI
AWS_PROFILE="<A_PROFILE_FROM_JANUS>"
AWS_DEFAULT_REGION="eu-west-1"

IMAGE_ACCOUNT_ID=$(aws ssm get-parameter --name /organisation/accounts/deployTools --query "Parameter.Value" --output text)
REGISTRY="${IMAGE_ACCOUNT_ID}.dkr.ecr.${AWS_DEFAULT_REGION}.amazonaws.com"
IMAGE="${REGISTRY}/guardian/dotcom-rendering${IMAGE_IDENTIFIER}"

# Login to AWS ECR https://docs.aws.amazon.com/AmazonECR/latest/userguide/registry_auth.html
aws ecr get-login-password | docker login --username AWS --password-stdin $REGISTRY

# Pull the image
docker pull $IMAGE

# Run the image. You'll likely need to set additional flags. See https://docs.docker.com/reference/cli/docker/container/run.
docker run $IMAGE

From guardian/actions-publish-image.

@aug24
aug24 force-pushed the jr/prep-for-prod-ecs branch 2 times, most recently from c9a5d27 to b06c2f1 Compare September 3, 2026 16:19
@aug24 aug24 added the run_chromatic Runs chromatic when label is applied label Sep 4, 2026
@aug24
aug24 marked this pull request as ready for review September 4, 2026 06:33
@aug24
aug24 requested a review from a team as a code owner September 4, 2026 06:33
@github-actions github-actions Bot removed the run_chromatic Runs chromatic when label is applied label Sep 4, 2026
@akash1810

Copy link
Copy Markdown
Member

I was thinking about this yesterday... this PR does 2 things:

  1. Provisions ECS resources for PROD
  2. Snapshot tests the PROD infrastructure

I wonder if tweaking things slightly would tell a cleaner story? For example:

  1. PR A adds a snapshot test for PROD as it currently stands
  2. PR B provisions the ECS infrastructure and updates the snapshot test

Here, the diff of PR B illustrates which parts of the infrastructure are for ECS.

WDYT?

@aug24
aug24 force-pushed the jr/prep-for-prod-ecs branch from b06c2f1 to f4a98fc Compare September 4, 2026 09:12
@aug24
aug24 changed the base branch from main to jr/add-tag-page-cdk-testing September 4, 2026 09:15
@aug24
aug24 force-pushed the jr/prep-for-prod-ecs branch from f4a98fc to ac283cb Compare September 4, 2026 09:24
},
},
instanceType: InstanceType.of(InstanceClass.C8G, InstanceSize.MEDIUM),
imageIdentifier: process.env.IMAGE_DIGEST!,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This implementation differs from the CODE one, which defaults to DEV. Should we be consistent across both?

@aug24 aug24 Sep 4, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think so, no. I think we explicitly fail if we can't find a value.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I think I've been misinterpreted. In this file (dotcom-rendering/cdk/bin/cdk.ts) we currently have

imageIdentifier: process.env.IMAGE_DIGEST ?? 'DEV',

This style differs from this change. Could the code style of each be the same? It becomes quite confusing otherwise IMO.

I think we explicitly fail if we can't find a value.

Additionally, I don't think we will explicitly fail as is. The ! here is a non-null assertion for TypeScript; it doesn't have any runtime implication.

@aug24
aug24 force-pushed the jr/prep-for-prod-ecs branch from ac283cb to c423b8c Compare September 4, 2026 10:49
Base automatically changed from jr/add-tag-page-cdk-testing to main September 4, 2026 11:00
@aug24
aug24 force-pushed the jr/prep-for-prod-ecs branch from c423b8c to 7e3afab Compare September 4, 2026 11:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature Departmental tracking: work on a new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants